from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Edge()
driver.maximize_window()
driver.get('http://10.59.9.12:7001/')

driver.find_element(By.XPATH,'//a[@href="/home/login.html"]').click()
time.sleep(1)
driver.find_element(By.NAME,'username').send_keys('18620064667')
time.sleep(1)
driver.find_element(By.NAME,'password').send_keys('123456')
time.sleep(10)
driver.find_element(By.XPATH,'//*[@id="theForm"]/div[5]/a').click()
time.sleep(2)
driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a').click()
time.sleep(1)
driver.find_element(By.CLASS_NAME,'search-input').send_keys('非洲之心')
time.sleep(1)
driver.find_element(By.XPATH,'//input[starts-with(@class,"search-input-btn")]').click()
time.sleep(1)
driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img').click()
time.sleep(1)
driver.find_element(By.ID,'store_nums').clear()
time.sleep(1)
driver.find_element(By.ID,'store_nums').send_keys('5')
time.sleep(1)
driver.find_element(By.ID,'buy-cart').click()
time.sleep(1)
driver.find_element(By.CLASS_NAME,'radio-select-btn').click()
time.sleep(1)
driver.find_element(By.CLASS_NAME,'ask-btn').click()
time.sleep(5)